package cn.ssm.service.serviceImpl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cn.ssm.dao.SeatMapper;
import cn.ssm.pojo.OrderSeat;
import cn.ssm.pojo.Seat;
import cn.ssm.service.SeatService;

/**
 * 座位业务实现类
 * 
 * @author 黄少涛
 *
 */
@Service
public class SeatServiceImpl implements SeatService {
	@Autowired
	SeatMapper seatmapper;

	/**
	 * 查询影厅座位最大行数与最大列数
	 * 
	 * @return
	 */
	@Override
	public Seat getRowLineMax(Integer scheduleId) {

		return seatmapper.getRowLineMax(scheduleId);
	}

	/**
	 * 查询已订座位详细位置
	 * 
	 * @return
	 */
	@Override
	public List<String> getOrderSeatList(Integer scheduleId) {

		return seatmapper.getOrderSeatList(scheduleId);
	}

	/**
	 * 根据排片编号查询全部座位
	 * 
	 * @param scheduleId
	 * @return
	 */
	@Override
	public List<Seat> getSeatList(Integer scheduleId) {

		return seatmapper.getSeatList(scheduleId);
	}
	
	/**
	 * 根据排片ID与座位座位的行与列查询到座位ID
	 * @param row
	 * @param line
	 * @param scheduleId
	 * @return
	 */
	@Override
	public int getSeatIdByRowAndLine(Integer row, Integer line, Integer scheduleId) {
	
		return seatmapper.getSeatIdByRowAndLine(row, line, scheduleId);
	}
	
	//查询订单座位关系表
	@Override
	public List<OrderSeat> getOrderSeat(Map<String, Object> map) {
		
		return seatmapper.getOrderSeat(map);
	}
	
	/**
	 * 增加已订座位
	 * @param orderId
	 * @param seatId
	 * @param orderSeat
	 * @return
	 */
	@Override
	public int addOrderSeat(Integer orderId, Integer seatId, String orderSeat) {
		
		return seatmapper.addOrderSeat(orderId, seatId, orderSeat);
	}
	
	//删除已订座位
	@Override
	public int deleteOrderSeat(Map<String, Object> map) {
		// TODO Auto-generated method stub
		return seatmapper.deleteOrderSeat(map);
	}
	
	//修改已订座位
	@Override
	public int updateOrderSeat(Map<String, Object> map) {
		
		return seatmapper.updateOrderSeat(map);
	}

	

}
